@layout("/layout/header.html"){}
		<!-- bootstrap & fontawesome -->
		
		<link rel="stylesheet" href="${ctxPath!}/static/css/font-awesome.min.css" />
		
		<link rel="stylesheet" href="${ctxPath!}/static/chosen/chosen.min.css" />

		<link rel="stylesheet" href="${ctxPath!}/static/css/datepicker.css" /><!-- 日期框 -->
		<link rel="stylesheet" href="${ctxPath!}/static/jquery-tags-input/jquery.tagsinput.css" />

		<script type="text/javascript" src="${ctxPath!}/static/chosen/chosen.jquery.min.js"></script>
		<script src="${ctxPath!}/static/jquery-tags-input/jquery.tagsinput.min.js"></script>
		<script type="text/javascript" src="${ctxPath!}/static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->
@var userOffice = office.getUserOfficeList(); //用户持有的机构
        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">
            <div class="row-content am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">边框表单</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" class="am-icon-cog"></a>
                                </div>
                            </div>
                            <div class="widget-body am-fr">

                                <form id="sysuser-save-form" class="am-form tpl-form-border-form tpl-form-border-br" method="post" action="${ctxPath!}/sysuser/save">
                                    <input type="hidden" value="${user.id!}" name="id"/>
                                    <div class="am-form-group">
                                        <label for="nickname" class="am-u-sm-3 am-form-label">真实姓名 <span class="tpl-form-line-small-title">Title</span></label>
                                        <div class="am-u-sm-9">
                                            <input type="text" class="tpl-form-input" name="name" value="${user.name!}" datatype="*"  nullmsg="请输入角色名！"  placeholder="请输入标题文字" >
                                            <small>请填写标题文字10-20字左右。</small>
                                        </div>
                                    </div>
 									<div class="am-form-group">
                                        <label for="username" class="am-u-sm-3 am-form-label">登录名 <span class="tpl-form-line-small-title">Title</span></label>
                                        <div class="am-u-sm-9">
                                            <input type="text" class="tpl-form-input" name="username" value="${user.username!}" datatype="*"  nullmsg="请输入登录名！" placeholder="请输入标题文字">
                                            <small>请填写标题文字10-20字左右。</small>
                                        </div>
                                    </div>
                                     <div class="am-form-group">
                                        <label for="password" class="am-u-sm-3 am-form-label">密码 <span class="tpl-form-line-small-title">Title</span></label>
                                        <div class="am-u-sm-9">
                                            <input type="password" class="tpl-form-input" name="password" value="${user.password!}" placeholder="请输入标题文字">
                                            <small>请填写标题文字10-20字左右。</small>
                                        </div>
                                    </div>
                                    
                                     <div class="am-form-group">
                                        <label for="password" class="am-u-sm-3 am-form-label">所属角色<span class="tpl-form-line-small-title">Title</span></label>
                                        <div class="am-u-sm-9">
                                            <select name="roleIds" multiple class="chosen-select tag-input-style" id="user-role-update" data-placeholder="选择角色">
						@for(entry in rolesMap!){
							@var key = entry.key,role=entry.value;
							<option value="${role.id!}" 
								@if(!isEmpty(findUserRoleMap[key])){
									selected
								@}
							>
							${role.name!}
							@var sostr = office.getOfficeStrByOfficeId(role.officeId);
							@if(!isEmpty(sostr)){
								&nbsp;(${sostr})
							@}
							</option>
						@}
					</select>
                                        </div>
                                    </div>
                                     <div class="am-form-group">
                                        <label for="password" class="am-u-sm-3 am-form-label">电话<span class="tpl-form-line-small-title">Title</span></label>
                                        <div class="am-u-sm-9">
                                            <input type="text" class="tpl-form-input" value="${user.mobile!}" name="moblie" placeholder="请输入标题文字" data-error="用户名或密码错误">
                                            <small>请填写标题文字10-20字左右。</small>
                                        </div>
                                    </div>
                                     <div class="am-form-group">
                                        <label for="password" class="am-u-sm-3 am-form-label">手机 <span class="tpl-form-line-small-title">Title</span></label>
                                        <div class="am-u-sm-9">
                                            <input type="text" class="tpl-form-input" value="${user.phone!}" name="phone"/>
                                            <small>请填写标题文字10-20字左右。</small>
                                        </div>
                                    </div>
                                     <div class="am-form-group">
                                        <label for="password" class="am-u-sm-3 am-form-label">邮箱 <span class="tpl-form-line-small-title">Title</span></label>
                                        <div class="am-u-sm-9">
                                            <input type="text" class="tpl-form-input" value="${user.email!}" name="email" placeholder="请输入标题文字">
                                            <small>请填写标题文字10-20字左右。</small>
                                        </div>
                                    </div>
                                     <div class="am-form-group">
                                        <label for="password" class="am-u-sm-3 am-form-label">工号 <span class="tpl-form-line-small-title">Title</span></label>
                                        <div class="am-u-sm-9">
                                            <input type="text" class="tpl-form-input" value="${user.no!}" name="no" placeholder="请输入标题文字">
                                            <small>请填写标题文字10-20字左右。</small>
                                        </div>
                                    </div>
                                     <div class="am-form-group">
                                        <label for="password" class="am-u-sm-3 am-form-label">描述 <span class="tpl-form-line-small-title">Title</span></label>
                                        <div class="am-u-sm-9">
                                             <textarea class="" rows="10" name="remarks" placeholder="请输入文章内容">${user.remarks!}</textarea>
                                        </div>
                                    </div>
     
                                    <div class="am-form-group">
                                        <div class="am-u-sm-9 am-u-sm-push-3">
                                            <button type="button" id="sysuserId" class="am-btn am-btn-primary tpl-btn-bg-color-success ">保存</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
    </div>
    <script src="${ctxPath}/static/assets/js/amazeui.min.js"></script>
    <script src="${ctxPath}/static/assets/js/amazeui.datatables.min.js"></script>
    <script src="${ctxPath}/static/assets/js/dataTables.responsive.min.js"></script>

<script type="text/javascript" src="${ctxPath!}/static/layer/layer.min.js"></script>
		<script type="text/javascript" src="${ctxPath}/static/validate/Validform_v5.3.2_min.js"></script>

		<script type="text/javascript">
			
		jQuery(function($) {
				$("#sysuser-save-form").Validform({
					btnSubmit:"#sysuserId",
					ajaxPost:true,
					beforeSubmit:function(curform){
						$("#sysuserId").attr("disabled","disabled").text("保存中…");
					},
					callback:function(data){
						if(undefined != data.error){
							$("#sysuserId").removeAttr("disabled").text("保存");
							var obj = $("#sysuser-save-form input[data-error='"+data.error+"']");
							layer.tips(data.error,obj, {
								guide:0,
								time: 4,
								style : ['background-color:#F26C4F; color:#fff','#F26C4F' ],
							});
						}else{
							var obj = $("#sysuser-save-form input[data-error='"+data.sucess+"']");
							window.location.href = "${ctxPath!}/sysuser/list";
						}
					},
					tiptype : function(msg, o, cssctl) {
						if (!o.obj.is("form")) {
							if (o.type != 2) {
								layer.tips(msg, o.obj, {
									guide:3,
									time: 4,
									style : ['background-color:#F26C4F; color:#fff','#F26C4F' ],
								});
							}
						}
					},
					tipSweep : true
				});
				
				$("#login-form").keydown(function(e){
					 var e = e || event,
					 keycode = e.which || e.keyCode;
					 if (keycode==13) {
					  $("#login-btn").trigger("click");
					 }
				});
				
			});
			// $("#user-role-update").chosen({width: "100%",search_contains: true}); 
		</script>
</body>

</html>